<div class="content_filtro">
    <div class="filtro">
        <form id="form_filtro" method="post" action="">
            <i>Pesquisar</i>
            
            <?php
            
                $query = 'SELECT SQL_CACHE ALU_ID,ALU_NOM FROM ALUNO WHERE ALU_STA = 1 ORDER BY ALU_NOM ASC';
                $f_cur = $this->db->fetchAll($query);

                $html = '<select id="cbfiltro" name="cbfiltro" class="chosen-select" >';
                $html .= '<option value="">Todos Alunos</option>';
                foreach($f_cur as $r){   
                    $select = $this->cbfiltro == $r['ALU_ID'] ? 'selected':''; 
                    $html .= '<option '.$select.' value="'.$r['ALU_ID'].'">'.$r['ALU_NOM'].'</option>'; 
                }
                $html .= '</select>';
                echo $html;
                
            ?>
            
            <input type="submit" value="buscar" name="buscar" class="btn-pdr">
            
        </form>
    </div>
    <?php if($this->per_add){?>
    <div class="content-btn">
        <span>Novo Recado</span><a href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'edit','id'=>'')); ?>">+</a>
    </div>
    <?php } ?>
</div>

<div class="content-list">
    
    <h2><?php echo $this->titulo;?></h2>
    
    <table id="tlist">
        <thead>
            <tr>
                <th>Data</th>
                <th>Hora</th>
                <th>Assunto</th>
                <th class="bc">&nbsp;</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($this->result as $row) { ?>
                <tr>
                    <td><?php echo Datetools::amd_dma($row['MRC_DAT']); ?></td>
                    <td><?php echo Datetools::hora_hm($row['MRC_HOR']); ?></td>
                    <td><?php echo $row['MRC_ASS']; ?></td>
                    <td class="bc">
                        <?php if($this->per_edt){?><a class="btn-pdr" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'edit', 'id' => $row['MRC_ID'])); ?>">Recado</a><?php }?>
                        <?php /* if($this->per_del && $row['MRC_STA'] == 0){?><a class="btn-pdr" href="javascript:void(0);" onclick="list_delete('<?php echo $this->controller; ?>', <?php echo $row['MRC_ID'] ?>, $(this));">Deletar</a><?php } */ ?>
                    </td>
                </tr>
            <?php } ?>
        </tbody>
    </table>
</div>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>